<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
			<meta name="renderer" content="webkit"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="IE=9" http-equiv="X-UA-Compatible" />
		<link rel="stylesheet" href="/Public/css/reset.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="/Public/css/style_content.css" type="text/css" media="screen" />
		<link href="/Public/css/uploadify.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="/Public/css/invalid.css" type="text/css" media="screen" />	
<script type="text/javascript" src="/Public/js/jquery-1.10.2.js"></script>
 <script type="text/javascript" src="/Public/js/jquery.uploadify.js"></script>		
 <script type="text/javascript" src="/Public/js/frame_js.js"></script>		
 <style>
.star{color:red;}
.uploadify-queue-item .cancel a {
	background: url('/Public/images/uploadify-cancel.png') 0 0 no-repeat;
}
</style>
	</head>

	<body>
		
		<script src="/Public/js/jquery.form.js" type="text/javascript"></script>
		 <script type="text/javascript" charset="utf-8" src="/Public/js/ueditor.config.js"></script>
								    <script type="text/javascript" charset="utf-8" src="/Public/js/ueditor.all.min.js"> </script>
								    <script type="text/javascript" charset="utf-8" src="/Public/js/lang/zh-cn/zh-cn.js"></script>
	<STYLE>
   .clear {  clear: both;   }
	.input_class{width:15px;height:10px;}
.star{color:red;}
	</STYLE>
		<div id="main-content">
			<!-- Page Head -->
			<div class="content-box"  style="margin: 0 auto;width:1000px;">
				<div class="content-box-header">
					<h3>单页面列表</h3>
					<div class="clear"></div>
				</div> 
				<div class="content-box-content">
						<div >
					<div class="notification attention png_bg"  >
							<a href="#" class="close"><img src="/Public/images/cross_grey_small.png" title="Close this notification" alt="close" /></a>
							<div >
								提示：<span class="star">&nbsp;&nbsp;*&nbsp;&nbsp;</span>为必填，其他选填！！
							</div>
						</div>
<!-- 						缩略图上传 -->
						<style>
	                     .upload-img-thumb{width:100%;position: relative;}
	                     .upload-img-thumb1{position: absolute;left:70%;border:1px solid #eee;border-top:2px solid #eec;-webkit-border-radius: 6px;border-radius: 6px;}
						.upload-img-thumb2{margin: 0 auto; width: 167px; margin-bottom: 20px;}
	                     #img_preview{width: 167px; height: 125px;}
	                     #file_upload{margin:0 auto;}
						</style>
							<div class="upload-img-thumb"></div>
							<div class="upload-img-thumb1">
							<div class="upload-img-thumb2">
								<img  <?php if($data['thumb']){?>src="<?=$data['thumb'] ?>" <?php }else{?> src="/Public/images/images.jpg" <?php }?>  id="img_preview">
							</div>
							<div style="width: 100%;">
									<div class="col-lg-6" style="width:100%;">
										<div class="input-group" >
													<input id="file_upload" name="thumb" type="file" multiple="true">
										</div>
										<div style="width:90px;margin:0 auto;">
										<a href="javascript:$('#file_upload').uploadify('cancel')" class="button" >删除</a>
										<a href="javascript:$('#file_upload').uploadify('upload')" class="button" style="">上传</a>
										</div>
									</div>
							</div>
							</div>
								<script type="text/javascript">
								    $(function() {
								        $('#file_upload').uploadify({
								       	 'auto'     : false,
								            'swf'      : '/Public/js/uploadify.swf',    //指定上传控件的主体文件
								            'uploader' : '/admin/logining/imgUpload',    //指定服务器端上传处理文件
								            'onUploadSuccess' : function(file, data, response) {
								                $("#img_preview").attr("src",data);
								 	 			$("#thumb").val(data);
								            }
								        });
								    });
								</script>
<!-- 							end 缩略图上传 -->
						<form action="/admin/page/savePage" method="post" id="article_add" >
							<input type="hidden"  name="id" value="<?php echo ($data['id']); ?>"  />
							<input type="hidden" name="thumb"  value="<?php echo ($data["thumb"]); ?>"  id="thumb"/>
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								<p>
										标题：<span class="star">*</span>&nbsp;<input class="text-input small-input not_null"  type="text"  name="title"  value="<?php echo ($data["title"]); ?>" />
										<span class="input-notification success png_bg">Successful message</span> 
								</p>
								<p>
									视图文件：
									<select name="view" >
										<?php $list=glob('./Application/Home/View/Index/page_*.php'); foreach ($list as $r){ $r=substr($r,30,count($r)-5);?>
										<option value="<?php echo $r?>"><?php echo $r?></option>
										    <?php }?> 
									</select>
									 <span class="input-notification  png_bg"></span>
								</p>
								<p>
								<label>描述：</label>
									<input class="text-input medium-input datepicker" type="text"  name="description"  value="<?php echo ($data["description"]); ?>"/> <span class="input-notification  png_bg"></span>
								</p>
								<p>
										<label>SEO-标题（seo_title）：</label>
									<input class="text-input medium-input datepicker" type="text"  name="seo_title"   value="<?php echo ($data["seo_title"]); ?>"/> <span class="input-notification  png_bg"></span>
								</p>
								<p>
								<label>SEO-关键字（seo_key）：</label>
									<input class="text-input medium-input datepicker" type="text"  name="seo_key"  value="<?php echo ($data["seo_key"]); ?>"/> <span class="input-notification  png_bg"></span>
								</p>
								<p>
								<label>SEO-描述（seo_decription）：</label>
									<input class="text-input large-input" type="text"  name="seo_description"  value="<?php echo ($data["seo_description"]); ?>"/>
								</p>
								
									<label><span class="star">*</span>&nbsp;内容：</label>        
								
								<script id="container" name="content" type="text/plain">
													<?php echo ($data["content"]); ?>
									</script>
									<script type="text/javascript">
									    var editor = UE.getEditor('container')
									</script>
								<p>
									<input class="button" type="button" value="保存"  id="tijiao" onclick="save();" />
								</p>
							</fieldset>
							<div class="clear"></div>
						</form>
					</div> 
					</div> 
					</div> 
					</div> 
					
<script>
//提交表单
$(function(){
						//表单检查是否为空
						$(".not_null").blur(function(){
							var obj=$(this).find("+span");
								 if($(this).val()==""){
									 obj.removeClass("success");
									 obj.addClass("error");
									 obj.html("不能为空！");
									 $("#tijiao").attr("disabled","disabled"); 
								 } else{
									 obj.removeClass("error");
									 obj.addClass("success");
									 $("#tijiao").removeAttr("disabled"); 
								 }
						});
	
});
										  function save(){
										      $("#article_add").submit();
										    }
									</script>

	</body>
  
</html>